//
//  BaseWebViewController.m
//  StockpdfReading
//
//  Created by mac on 2017/6/23.
//  Copyright © 2017年 上海LOL信息技术服务有限公司. All rights reserved.
//

#import "BaseWebViewController.h"
#import <WebKit/WebKit.h>



@interface BaseWebViewController ()

@property (nonatomic, strong) WKWebView *wkWebView;

@end

@implementation BaseWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    [self p_loadRequest];
}

#pragma mark --- private method
-(void)p_loadRequest{
    [self.wkWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]];
}

#pragma mark --- setupUI
-(void)setupUI{
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.title = self.webTitle;
    [self.view addSubview:self.wkWebView];
    [self.wkWebView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}


#pragma mark ---- set get

- (WKWebView *)wkWebView{
    if (!_wkWebView){
        _wkWebView = [[WKWebView alloc]init];
    }
    return _wkWebView;
}

@end



